/*
 * PassLogger.cpp
 *
 *  Created on: Oct 9, 2014
 *      Author: root
 */

#include "PassLogger.h"


namespace LoggerNameSpace {

PassLogger::PassLogger (string satId)
{
	timespec timespc;
	struct tm * timeinfo;
	char buffer [30];
	char filename [30];

	//clock_gettime(CLOCK_REALTIME, &timespc);
	timeinfo = localtime (&timespc.tv_sec);
    strftime (buffer,30,"%Y-%m-%d[%H%M%S]",timeinfo);
    sprintf(filename, "%s %s.log",satId.c_str(),buffer);
    logger = new Logger(string(SATLOGSPATH) + string(filename));
}

PassLogger::~PassLogger ()
{
}

void PassLogger::log (string text)
{
	logger->logInfo(text);
}

} /* namespace LoggerNameSpace */
